package com.scb.dev.mms.feign;

import com.scb.dev.mms.common.ResponseResult;
import com.scb.dev.mms.request.RoleVORequest;
import org.apache.ibatis.annotations.Param;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * ClassName: EmployeeMapper
 * Description: Authority Feign Interface
 * Date: 2018/11/27 2:16 PM
 *
 * @author Wang, Haoyue
 * @version V1.0
 * @since JDK 1.8
 */
@FeignClient(name = "mms-provider-authority")
public interface AuthorityFeign {

    /**
     * getMenuTree: Call mms-provider-authority to generate Menu Tree
     *
     * @param roleId
     * @return ResponseResult
     */
    @RequestMapping(value = "/sm/menu/menu/{roleId}", method = RequestMethod.GET)
    ResponseResult getMenuTree(@PathVariable("roleId") String roleId);

    /**
     * queryRoleName: Call mms-provider-authority to get roleName by roleId
     *
     * @param roleId
     * @return ResponseResult
     */
    @RequestMapping(value = "/sm/role/roleName/{roleId}", method = RequestMethod.GET)
    ResponseResult queryRoleName(@PathVariable("roleId") String roleId);


    @RequestMapping(value = "/sm/role/selectAllRoleName", method = RequestMethod.GET)
    public ResponseResult queryAllRoleName();


    @RequestMapping(value = "/sm/role/selectAllRole", method = RequestMethod.GET)
    public ResponseResult queryAllRole();

    @RequestMapping(value = "/sm/role/selectMenus/{roleId}", method = RequestMethod.GET)
    public ResponseResult queryMenusByRoleId(@PathVariable("roleId") String roleId);

    @RequestMapping(value = "/sm/role/addRole", method = RequestMethod.POST)
    public ResponseResult addRole(@RequestBody RoleVORequest roleVORequest);

    @RequestMapping(value = "/sm/role/delete/{roleId}", method = RequestMethod.DELETE)
    public ResponseResult delete(@PathVariable("roleId") String roleId);

    @RequestMapping(value = "/sm/role/updateRole", method = RequestMethod.PUT)
    ResponseResult updateRole(@RequestBody RoleVORequest roleVORequest);
}
